#include <cstdio>

typedef long long ll;
const int N = 1005, mod = 1e9 + 7;
int n, m, x, y;
double a[N][N], f[N][N];

inline void build(int x) {
  a[1][1] = 2, a[1][2] = -1, a[1][m + 1] = 3 + f[x + 1][1];
  for (int i = 2; i < m; ++i)
    a[i][i] = 3, a[i][i - 1] = -1, a[i][i + 1] = -1, a[i][m + 1] = 4 + f[x + 1][i];
  a[m][m] = 2, a[m][m - 1] = -1, a[m][m + 1] = 3 + f[x + 1][m];
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("CppTest.in", "r", stdin);
  freopen("CppTest.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d%d", &n, &m, &x, &y);
  if (m == 1) return printf("%d", (n - x) << 1), 0;
  for (int i = n - 1; i >= x; --i) {
    build(i);
    for (int j = 1; j < m; ++j) {
      double rate = a[j + 1][j] / a[j][j];
      a[j + 1][j] -= rate * a[j][j], a[j + 1][j + 1] -= rate * a[j][j + 1];
      a[j + 1][m + 1] -= rate * a[j][m + 1];
    }
    f[i][m] = a[m][m + 1] / a[m][m];
    for (int j = m - 1; j; --j) f[i][j] = (a[j][m + 1] + f[i][j + 1]) / a[j][j];
  }
  printf("%lf", f[x][y]);
  return 0;
}